package com.asialjim.wechat.core.api;

import com.asialjim.wechat.apiservice.ApiResponse;
import java.io.Serializable;

/**
 * <h1><em>ASIAL JIM JAVA DOC</em></h1><hr/>
 * <h2>CLASS DESCRIPTION <i>[ NAME: WeChatApiRes ]</i></h2><strong>
 * <p> WE CHAT API RESPONSE
 * </strong><p><p><em>Copyright &copy; Asial Jim Co., LTD</em><hr/>
 *
 * @author Asial Jim &nbsp;&nbsp; <span>Email:<a href="mailto:asialjim@hotmail.com">asialjim@hotmail.com</a> &nbsp;&nbsp; <a href="asialjim@qq.com">asialjim@qq.com</a></span>
 * @version 1.0.0
 * @since 2021/2/27   &nbsp;&nbsp; JDK 8
 */
public interface WeChatApiRes<T> extends ApiResponse<T>, Serializable {

    /**
     * <h3>METHOD DESCRIPTION <i>[ NAME: isSuccess ]</i></h3>
     * we chat api execute is success
     * @return boolean
     * @author Asial Jim &nbsp;&nbsp;<span>Email:asialjim@hotmail.com &nbsp;&nbsp; asialjim@qq.com</span>
     * @since 2021/2/27 12:41
     */
    boolean isSuccess();

    /**
     * <h3>METHOD DESCRIPTION <i>[ NAME: isNotSuccess ]</i></h3>
     * we chat api execute is not success
     * @return boolean
     * @author Asial Jim &nbsp;&nbsp;<span>Email:asialjim@hotmail.com &nbsp;&nbsp; asialjim@qq.com</span>
     * @since 2021/2/27 12:41
     */
    default boolean isNotSuccess(){
        return !isSuccess();
    }

    /**
     * <h3>METHOD DESCRIPTION <i>[ NAME: parse ]</i></h3>
     * parse to we chat api res java object
     * @return {@link T response object}
     * @author Asial Jim &nbsp;&nbsp;<span>Email:asialjim@hotmail.com &nbsp;&nbsp; asialjim@qq.com</span>
     * @since 2021/2/27 12:57
     */
    T parse();

    /**
     * <h3>METHOD DESCRIPTION <i>[ NAME: getErrcode ]</i></h3>
     * get we-chat api response error code
     * @return {@link Integer error code}
     * @author Asial Jim &nbsp;&nbsp; <span>Email: &nbsp;&nbsp; <a href="mailto:asialjim@hotmail.com">asialjim@hotmail.com</a> &nbsp;&nbsp; <a href="asialjim@qq.com">asialjim@qq.com</a></span>
     * @since 2021/3/3 11:39
     */
    Integer getErrcode();

    /**
     * <h3>METHOD DESCRIPTION <i>[ NAME: getErrmsg ]</i></h3>
     * get we-chat api response error message
     * @return {@link String error message}
     * @author Asial Jim &nbsp;&nbsp; <span>Email: &nbsp;&nbsp; <a href="mailto:asialjim@hotmail.com">asialjim@hotmail.com</a> &nbsp;&nbsp; <a href="asialjim@qq.com">asialjim@qq.com</a></span>
     * @since 2021/3/3 11:39
     */
    String getErrmsg();
}
